package com.zhongge.customarraylist;

/**
 * @ClassName Test
 * @Description TODO
 * @Author zhongge
 * @Version 1.0
 */
@SuppressWarnings("all")
public class Test {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add("1");
        myArrayList.add("2");
        myArrayList.add("3");
        myArrayList.add("4");
        myArrayList.add("5");
        myArrayList.add("6");
        myArrayList.add("7");
        myArrayList.add("中国");
        System.out.println(myArrayList);

        System.out.println("========获取值=========");

        System.out.println(myArrayList.get(7));

        System.out.println("==========修改数值=========");
        myArrayList.updata(0, "中国");
        System.out.println(myArrayList);

        System.out.println("==========删除数值=========");
        System.out.println(myArrayList.remove(7));
        System.out.println(myArrayList);

        System.out.println("==========获取数值是索引=========");
        System.out.println(myArrayList.indexOf("中国"));

        System.out.println("==========集合中元素实现乱序=========");
        System.out.println(myArrayList);
        for (int i = 0; i < 10; i++) {
            myArrayList.shuffle();
        }
        System.out.println(myArrayList);

        System.out.println("==========集合中元素实现倒序=========");
        System.out.println(myArrayList);
        myArrayList.reverse();
        System.out.println(myArrayList);
    }
}
